//
//  MainCell.m
//  MyDemo
//
//  Created by jay on 2020/8/22.
//  Copyright © 2020 jay. All rights reserved.
//

#import "MainCell.h"

@implementation MainCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    return self;
}

-(UILabel *)titleLabel {
    if (_titleLabel == nil) {
        _titleLabel = [UILabel labelText:@"" font:TX_FONT(14) color:TX_COLOR_FROM_RGB(0x333333) align:NSTextAlignmentLeft lines:0];
        [self addSubview:_titleLabel];
        
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.top.mas_equalTo(10);
        }];
    }
    return _titleLabel;
}

-(UILabel *)contentLabel {
    if (_contentLabel == nil) {
        _contentLabel = [UILabel labelText:@"" font:TX_FONT(13) color:TX_COLOR_FROM_RGB(0x666666) align:NSTextAlignmentLeft lines:0];
        [self addSubview:_contentLabel];
        
        [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleLabel);
            make.right.mas_equalTo(self.titleLabel);
            make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_equalTo(5);
            make.bottom.mas_equalTo(-10);
        }];
    }
    return _contentLabel;
}

@end
